﻿<Window x:Class="ThreadingPrimeNumberSample.PrimeMVVM"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="PrimeMVVM"
        Width="260"
        Height="180">
    <Window.Resources>
        <Style x:Key="FivePixelMargin"
               TargetType="{x:Type FrameworkElement}">
            <Setter Property="Margin"
                    Value="5" />
        </Style>
        <Style x:Key="OutputText"
               TargetType="{x:Type TextBlock}">
            <Setter Property="Margin"
                    Value="5 0 0 0" />
        </Style>
        <Style TargetType="{x:Type GroupBox}"
               BasedOn="{StaticResource FivePixelMargin}" />
        <Style TargetType="{x:Type Button}"
               BasedOn="{StaticResource FivePixelMargin}" />
    </Window.Resources>
    <StackPanel VerticalAlignment="Center">
        <GroupBox Header="Threads" Margin="5">
            <StackPanel>
                <StackPanel Orientation="Horizontal">
                    <TextBlock>GUI Thread ID:</TextBlock>
                    <TextBlock Text="{Binding GuiThreadID}"
                               Style="{StaticResource OutputText}" />
                </StackPanel>
                <StackPanel Orientation="Horizontal">
                    <TextBlock>Worker Thread ID:</TextBlock>
                    <TextBlock Text="{Binding WorkerThreadID}"
                               Style="{StaticResource OutputText}"/>
                </StackPanel>
            </StackPanel>
        </GroupBox>
        <GroupBox Header="Output">
            <StackPanel Orientation="Horizontal">
                <TextBlock>Biggest Prime Found:</TextBlock>
                <TextBlock Text="{Binding PrimeNumber}"
                           Style="{StaticResource OutputText}"/>
            </StackPanel>
        </GroupBox>
        <Button Content="{Binding ButtonText}"
                Command="{Binding StartStopCommand}"/>
    </StackPanel>
</Window>
